jQuery.fn.qbox=function(options){
    var node = this.get(0).nodeName.toLowerCase();
    var self=this;
    if (node == 'a') {
        $(this).attr('onclick','').unbind('click').click(function(){return false;});
        options = $.extend({src:this.get(0).getAttribute('href'),beforeUnload:function(){ $(self).unbind('click').click(function(){return $(this).qbox(options);});}},options||{}); 
    }
   qBox.iFLoad(options);
   return false;
}
function qBox(){};
var dialogsMap = {};
jQuery.extend(qBox,{
    dialogs:dialogsMap,
    iFrame:function(options){ 
		if(qBox.dialogs[options.appid]){
			var _existed_Dialog = qBox.dialogs[options.appid];
			if(_existed_Dialog.visible == false) {
				_existed_Dialog.show();
			}
			$("#task_" + _existed_Dialog.options.appid).removeClass('window_min');
			_existed_Dialog.toTop();
			return false;
		}
	
		options = jQuery.extend({title:'提示',src:'about:blank'},options);//
		
		var scroll = 'no';
		
		if(options.scroll) {
			scroll = options.scroll;
		}
		
	            var dialog = new Boxy("<iframe id=\"iframe_"+options.appid+"\" style=\"width:" + options.windowMinSize.wMinWidth +";height:" + options.windowMinSize.wMinHeight + ";display:none;padding:0;\" src="+options.src+" frameborder=\"0\" scrolling=" + scroll +"></iframe>",options);            
	            jQuery("#iframe_"+options.appid).load(function(){   
	                  //jQuery("#ld"+op.appid).remove();
	                  jQuery("#iframe_"+options.appid).css({'padding':'0px','display':'block'});
	            }); 
	            qBox.dialogs[options.appid]=dialog;
	            return;
	    }
});




/**
 * hashmap类
 * @return
 */
function hashMap(){  
    value={};  
    var size=0;  
    //清除所有的值
    this.clear=function(){  
         value={};  
    }  
      
    /** 
     * 判断key是否存在 
     * @param key 
     * @return Boolean  
     */  
    this.containsKey=function(key){  
        return Boolean(key in value);  
    }  
    /** 
     * 判断值是否存在 
     * @param value 
     * @return Boolean 
     */  
    this.containsValue=function(key){  
        var str=value.toSource();  
        return str.indexOf(key)==-1 ? false: true;  
    }  
    /** 
     * 返回key对应的v 
     */  
    this.get=function(key){  
        return value[key];  
    }  
    /** 
     * 判断是否为空 
     * @return Boolean 
     */  
    this.isEmpty=function(){  
        return size==0? true:false;  
    }  
    /** 
     * 取出所有的key 
     * @return Array() 
     */  
    this.keySet=function(){  
        var arr=new Array();  
        for(var i in value){  
            arr.push(i);  
        }  
        return arr;  
    }  
    /** 
     * 将key，value放入对象 
     * @param key  
     * @param value 
     */  
    this.put=function(key,value){  
        value[key]=value;  
        if(!this.containsKey(key)){  
             size++;  
        }  
         
    }  
    /** 
     * 删除key对应的value 
     * @param key 
     * @return value与 key 关联的旧值 
     */  
    this.remove=function(key){  
        var o=this.get(key);  
        if(o){  
            delete value[o];  
            return o;  
        }else{  
            return null;  
        }  
    }  
    /** 
     * 返回此HashMap的大小 
     * @reaturn Int 
     */  
    this.size=function(){  
        return size;  
    }  
    /** 
     * 返回此map所有的value集合 
     * @return Connections 
     */  
    this.values=function(){  
        var arr=new Array();  
        for (var i in value) {  
            arr.push(value[i])  
        }  
        return arr;  
    }  
    
    /**
     * 返回此map
     */
    this.getvalue=function(){  
        return value;  
    }  
      
} 
